// import SailorTable from './components/SailorTable'
// import SailorTableColumn from './components/SailorTable/column.js'
// import scFilterBar from './components/SailorFilterBar'
// import scUpload from './components/SailorUpload'
// import scUploadMultiple from './components/SailorUpload/multiple'
// import scUploadFile from './components/SailorUpload/file'
// import scFormTable from './components/SailorFormTable'
// import SailorTableSelect from './components/SailorTableSelect'
// import scPageHeader from './components/SailorPageHeader'
// import scSelect from './components/SailorSelect'
// import scDialog from './components/SailorDialog'
// import scForm from './components/SailorForm'
// import scTitle from './components/SailorTitle'
// import scWaterMark from './components/SailorWaterMark'
// import scQrCode from './components/SailorQrCode'
//
// import scStatusIndicator from './components/SailorMini/scStatusIndicator'
// import scTrend from './components/SailorMini/scTrend'
//
import auth from './directives/auth'
import auths from './directives/auths'
import authsAll from './directives/authsAll'
import role from './directives/role'
import time from './directives/time'
import copy from './directives/copy'

import errorHandler from './utils/errorHandler'

import * as elIcons from '@element-plus/icons-vue'
import * as SailorIcons from './assets/icons'

export default {
    install(app) {
        //注册全局指令
        app.directive('auth', auth)
        app.directive('auths', auths)
        app.directive('auths-all', authsAll)
        app.directive('role', role)
        app.directive('time', time)
        app.directive('copy', copy)

        //统一注册el-icon图标
        for (let icon in elIcons) {
            app.component(`ElIcon${icon}`, elIcons[icon])
        }
        //统一注册Sailor-icon图标
        for (let icon in SailorIcons) {
            app.component(`SailorIcon${icon}`, SailorIcons[icon])
        }

        //关闭async-validator全局控制台警告
        window.ASYNC_VALIDATOR_NO_WARNING = 0

        //全局代码错误捕捉
        app.config.errorHandler = errorHandler
    }
}
